#pragma once
#include "Object.h"
#include "Sprites.h"
#include "windows.h"
#include "QuadTree.h"
#include "GScreen.h"
#include "Infomation.h"
#include "Sound.h"

#include <math.h>

#define ENEMY_NORMAL_SPEED	0.2
#define	ENEMY_HIGH_SPEED	0.4
#define DELTA_TIME 1000/60

#define TURTLE_M_W	35
#define TURTLE_M_H	50
#define TURTLE_D_W	35
#define TURTLE_D_H	35

#define GOOMBAS_W	35
#define GOOMBAS_H	35


enum Direction{Letf=-1,Right=1};

class CEnemy: public Object
{
	static LPDIRECT3DTEXTURE9 _enemyImage;
protected:float		vX;
		  DWORD		lastTime;
		  bool		isUp;
public:
	Direction		_direction;
	bool			_justMove;
	CScreen*		_screen;
	QuadTree*		_quadTree;
	static void InitResoure(){_enemyImage=CSprites::LoadTexture("Images\\Enemies.png",0);}
	CEnemy(void)
	{
		_pRECT=new RECT();
		_pSprite=NULL;
	}
	void SetVX(float vx){vX=vx;}
	CEnemy(int left,int top,CScreen *sc,QuadTree *q,int kind,SOUND *sManager);
	void Draw(int VirtualLeft,int Style);
	int Move();
	void Collision(Object *Ob);
	~CEnemy(void);
	void Release(){}
	int CheckLeftRight();
	int CheckUpDown(bool IsUp);
	void Die();
	void Jump();
	void ChangeDirectory();
	void ChangeStatus(int style);	
	void EnemyFly(int limTop, int limBottom);
	
};
